package com.wcarmon.life.business {

    import com.adobe.cairngorm.business.ServiceLocator;
    import com.adobe.cairngorm.business.IServiceLocator;
    import com.adobe.cairngorm.commands.ICommand
    import com.adobe.cairngorm.control.CairngormEvent;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.IResponder;
	import flash.utils.*;
	
	public class CompleteRejectBlockDelegate {
		include "../../includes/loggerSnippet.as";
		
		private var responder : IResponder;
		private var service : Object;
		
		public function CompleteRejectBlockDelegate( responder : IResponder ){
			this.service = ServiceLocator.getInstance().getRemoteObject("LifeOrganizeService");
			this.responder = responder;
			log.info( 'Using this php file: ' + this.service.source );
		}
		public function complete( block_id : uint ) : void {
			log.debug('completing block #' + block_id);
			var call : Object = service.complete( block_id );
			call.addResponder( responder );
		}
		public function unComplete( block_id : uint ) : void {
			log.debug('uncompleting block #' + block_id);
			var call : Object = service.unComplete( block_id );
			call.addResponder( responder );
		}
		public function reject( block_id : uint ) : void {
			log.debug('rejecting block #' + block_id);
			var call : Object = service.reject( block_id );
			call.addResponder( responder );
		}
		public function unReject( block_id : uint ) : void {
			log.debug('unrejecting block #' + block_id);
			var call : Object = service.unReject( block_id );
			call.addResponder( responder );
		}
	}
}